package com.matea.user.utils;


import com.matea.user.VO.ResultVO;
import com.matea.user.enums.ResultEnum;

/**
 * Created by Matea on 2018/11/17.
 */
public class ResultVOUtil {

    public  static ResultVO success(Object object){
        ResultVO resultVO = new ResultVO();
        resultVO.setData(object);
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        return  resultVO;
    }

    public  static ResultVO success(){
        ResultVO resultVO = new ResultVO();
        //resultVO.setData(object);
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        return  resultVO;
    }

    public  static ResultVO error(ResultEnum  result){
        ResultVO resultVO = new ResultVO();
        //resultVO.setData();
        resultVO.setCode(result.getCode());
        resultVO.setMsg(result.getMessage());
        return  resultVO;
    }

}

